package com.wptai.douyin.open.api.data.star;

import com.wptai.douyin.config.AppConfig;
import com.wptai.douyin.open.api.data.star.enume.StarHostEnum;
import com.wptai.douyin.open.api.token.AccessTokenApi;
import com.wptai.douyin.open.base.ApiBase;
import com.wptai.douyin.open.base.ApiResponse;

public class StarHostListApi extends ApiBase {

    public static String API_URL = AppConfig.getInstance().httpUrl+"/star/hot_list/";

    public StarHostListResult get(StarHostListParam param ){

        AccessTokenApi accessTokenApi = new AccessTokenApi();
        String clientAccessToken = accessTokenApi.get().getAccessToken();

        param.setAccessToken(clientAccessToken);

        String url = API_URL+"?"+param.getNoPageUrlParam();
        ApiResponse response = sendGet(url);
        StarHostListResult result = response.dataToBean(StarHostListResult.class);
        return result;
    }

    public StarHostListResult get(StarHostEnum starHostEnum){
        StarHostListParam param = new StarHostListParam();
        param.setHostListType(starHostEnum.getId());
        return this.get(param);
    }

    public StarHostListResult get(Integer typeIndex){
        StarHostListParam param = new StarHostListParam();
        param.setHostListType(typeIndex);
        return this.get(param);
    }

    public StarHostListResult get(){
        StarHostListParam param = new StarHostListParam();
        return this.get(param);
    }

    @Override
    public ApiBase withAccessToken(String accessToken) {
        return null;
    }

    @Override
    public ApiBase withOpenId(String openId) {
        return null;
    }

    @Override
    public String scope() {
        return null;
    }
}
